
package com.kugou.game.sdk.ui.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;

import com.kugou.framework.v4.ViewPager;

/**
 * 描述:滑动事件能传到子viewPager。主要用于viewPager嵌套时的父viewPager
 * 
 * @author chenys
 * @since 2013-9-29 下午2:22:28
 */
public class ParentViewPager extends ViewPager {
    public ParentViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ParentViewPager(Context context) {
        super(context);
    }

    @Override
    protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
        if (v != this && v instanceof ViewPager) {
            return true;
        }
        return super.canScroll(v, checkV, dx, x, y);
    }
}
